package com.hyc.myvideo.ui.view;

import android.view.Gravity;
import android.view.View;

import com.hyc.myvideo.R;
import com.hyc.myvideo.data.api.model.ModelLive;
import com.hyc.myvideo.ui.base.BaseDialogFragment;

import butterknife.OnClick;

/**
 * 弹框提示-直播弹出是否支付
 * @author  gyb
 * @version 1.0
 * @created 2017/8/11
 */

public class DialogLivePay extends BaseDialogFragment {
    private ModelLive modelLive = null;

    private payInterface payInterface = null;

    public DialogLivePay(DialogLivePay.payInterface payInterface) {
        this.payInterface = payInterface;
    }
    public void setModelLive(ModelLive modelLive) {
        this.modelLive = modelLive;
    }

    public void onLook() {
        if(payInterface != null){
            payInterface.onLook();
        }

    }

    public void onPay() {
        if(payInterface != null){
            payInterface.onPay();
        }

    }

    @Override
    public int getContentViewId() {
        return R.layout.dialog_live_vip;
    }

    @Override
    public int getGravity() {
        return Gravity.CENTER;
    }

    @Override
    protected void initView() {
    }
    @OnClick({R.id.dialog_pay_look, R.id.dialog_pay_confirm})
    public void onClick(View v) {
       switch (v.getId()){
           //试看
           case R.id.dialog_pay_look:
               onLook();
               hideDialog();
               break;
           //确定支付
           case R.id.dialog_pay_confirm:
               onPay();
               hideDialog();
               break;
       }
    }

    public interface payInterface{
        void onLook();
        void onPay();
    }
}
